#!/bin/sh

. /lib/functions/openvpn.sh

[ -e "/etc/openvpn.user" ] && {
	env -i ACTION="$ACTION" INSTANCE="$INSTANCE" \
		/bin/sh \
		/etc/openvpn.user \
		$*
}

# Wrap user defined scripts on up/down events
case "$ACTION" in
	up|down)
		if get_openvpn_option "$config" command "$ACTION"; then
			shift
			exec /bin/sh -c "$command $*"
		fi
	;;
esac

exit 0
